<template>
    <div>
        <div class="Detail">
            <h1>我是 Detail</h1>
            通过当前路由规则获取：{{$route.params.id}}
            <br>
            通过开启 props 获取: {{ id }}
            <br>
            {{num}}
        </div>
    </div>
</template>

<script>
import bus from '@/assets/js/eventBus'
export default {
    name: "Detail",
    props: ['id'],
    data () {
        return {
            num: 0
        }
    },
    mounted() {
        let that = this
        bus.$on('AboutEvent', function (n) {
            that.num += n
        })
    }
}
</script>

<style lang="less" scoped>

</style>